[client-v2,jdbc-v2] Fix Writing Date/Time values #2710
Merged
Conversation
…d write back with different timezone
Client V2 CoverageCoverage Report
Class Coverage
|
jdbc-v2/src/main/java/com/clickhouse/jdbc/WriterStatementImpl.java
Outdated
Show resolved
Hide resolved
client-v2/src/test/java/com/clickhouse/client/api/DataTypeUtilsTests.java
Show resolved
Hide resolved
jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java
Outdated
Show resolved
Hide resolved
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
mzitnik
approved these changes
Feb 24, 2026
client-v2/src/test/java/com/clickhouse/client/api/DataTypeUtilsTests.java
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Closes #2701
Closes #2065
Closes #2496
Closes #1220
Closes #1117
Closes #1048
Closes #2381
Closes #1735
Closes #2542
Closes #2557
Checklist
Delete items not relevant to your PR:
Note
Medium Risk
Touches core JDBC parameter encoding and
ResultSetdate/time conversion paths, so regressions could surface as subtle timezone/day-shift or precision issues across environments. Changes are well-covered with expanded unit/integration tests but affect widely used APIs.Overview
Fixes JDBC/client-v2 handling of
Date/Time/Timestampvalues to be timezone-explicit and avoid day-shift/precision bugs when usingCalendaror non-default zones.DataTypeUtilsadds bidirectional SQL↔java.time conversion helpers plus safe nanosecond unix-timestamp string generation (overflow-safe) and improved time/datetime formatters. JDBCPreparedStatementImpl,WriterStatementImpl, andResultSetImplare updated to consistently usedefaultCalendar(instead ofnull) and these new utilities; parameter encoding now supportsDurationforTime64, encodesLocalDateTime/InstantviafromUnixTimestamp64Nano(...), and validatessetObject(..., targetSqlType)types instead of emitting implicitCASTs.Client record readers (
AbstractBinaryFormatReader,MapBackedRecord) now allowTime/Time64values read asLocalDateTimeto be retrieved asDuration. Tests are heavily expanded/adjusted to cover timezone round-trips and day-shift edge cases; several implicit type-cast tests are disabled as invalid behavior.Written by Cursor Bugbot for commit 4ae6fdf. This will update automatically on new commits. Configure here.